<template>
  <el-form-item label="触发字段">
    <el-select v-model="currValue" @change="onChange">
      <el-option v-for="(item, index) in options.attribute.columns" :key="item.id + index" :label="item.label" :value="item.prop"></el-option>
    </el-select>
  </el-form-item>
</template>

<script>
export default {
  name: 'interaction-table',
  cnName: '表格交互',
  props: {
    options: Object
  },
  data() {
    return {
      currValue: ''
    }
  },
  methods: {
    onChange(val) {
       this.$emit('change', val)
    }
  },
  mounted() {
    console.info('mabi')
    if(this.options.attribute.columns.length > 0) {
      this.currValue = this.options.attribute.columns[0].prop
      console.info('cao', this.currValue)
      this.$emit('change', this.currValue)
    }
  }
}
</script>

<style lang="less" scoped>
.interaction-table {
}
</style>
